using System;
using System.ComponentModel.DataAnnotations;

namespace UserManagementService.DTOs;

/// <summary>
/// 导入用户数据输入DTO
/// </summary>
public class ImportUsersDto
{
    /// <summary>
    /// 文件数据
    /// </summary>
    [Required]
    public byte[] FileData { get; set; }

    /// <summary>
    /// 文件名
    /// </summary>
    [Required]
    public string FileName { get; set; }

    /// <summary>
    /// 文件格式
    /// </summary>
    public ImportFormat Format { get; set; }

    /// <summary>
    /// 是否跳过重复用户
    /// </summary>
    public bool SkipDuplicates { get; set; } = true;

    /// <summary>
    /// 是否激活新用户
    /// </summary>
    public bool ActivateNewUsers { get; set; } = true;

    /// <summary>
    /// 新用户默认密码（如果不提供则使用随机密码）
    /// </summary>
    public string DefaultPassword { get; set; }

    /// <summary>
    /// 发送欢迎邮件
    /// </summary>
    public bool SendWelcomeEmail { get; set; } = false;

    /// <summary>
    /// 是否更新已存在的用户
    /// </summary>
    public bool UpdateExistingUsers { get; set; } = false;
}

/// <summary>
/// 导入格式枚举
/// </summary>
public enum ImportFormat
{
    /// <summary>
    /// Excel格式
    /// </summary>
    Excel = 1,

    /// <summary>
    /// CSV格式
    /// </summary>
    Csv = 2,

    /// <summary>
    /// JSON格式
    /// </summary>
    Json = 3
}